<?php 
/**
 * @version			$Id$
 * @author			Richard Asp
 * @package			Joomla
 * @subpackage		gnudoor
 * @copyright		(C) 2010 gnudoor LLC
 * @license      GNU/GPL, see LICENSE.php
 * Joomla! is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * See COPYRIGHT.php for copyright notices and details.
 */

defined( '_JEXEC' ) or die( 'Restriced access' );
// JHTML::_('script','accTest.js','components/com_gnudoor/assets/js/',FALSE);
JHTML::_('stylesheet', 'scheduler.css','components/com_gnudoor/assets/css/');
JHTML::_('stylesheet', 'form.css','components/com_gnudoor/assets/css/');
JHTML::_('behavior.mootools');
$params = &JComponentHelper::getParams( 'com_gnudoor' );
$topalias = $params->get( 'Appointment Top' );
$bottomalias = $params->get( 'Appointment Bottom' );

$model =& $this->getModel('Appt');
$topID = $model->getArticleID($topalias);
$topid = $topID->id;
$bottomID = $model->getArticleID($bottomalias);
$bottomid = $bottomID->id;
?>
<?php echo file_get_contents($this->articlebase . $topid);?>
<style type="text/css">
<!--
.closed {background-color:#E7CACA}
-->
</style>

<div><?php echo $this->left; ?>&nbsp;&nbsp;&nbsp;<?php echo $this->right; ?></div>
<div id="list_container" class="mylist">
<table class="weekCont" id="container" cellspacing="0" cellpadding="0">
  <thead>
    <tr class="dayHeading">
      <th width="41px">Slots
<?php 
/*
 * This section of the page displays the header days of
 * the appointments.  They are listed Sun -> Sat
 */
		for ( $m = 0; $m < 7; $m++ ) { ?>
		<th><div class="fixwidth"></div><?php echo $this->wname[$m]; ?></th>
<!--      <th class="todayHead"><div class="fixwidth"></div></th>-->


<?php } ?>
    </tr>
  </thead>

  <tbody style="line-height:21px">
    <tr>
      <td><div class="hour">
<?php  
/*
 * This section displays the rows of slots designated
 * by the provider.
 */
	$n = 0; 
	foreach( $this->slot as $row) { ?>
<?php 
	if ($rowtype == 0 ) {
		echo '<tr class="e">';
		$rowtype++;
	} else {
		echo '<tr class="o">';
		$rowtype = 0;
	}
?>
		<td><div class="fixwidth"></div><?php echo $row['english']; ?></td>
<?php  for ( $i=0; $i < 7; $i++ ) { ?>
		<td>
			<div class="fixwidth"></div>
			<?php echo $this->day[$n][$i]; ?>
		</td>
<?php  }  ?>
	</tr>
<?php  $n++; } ?>

      </div></td>
    </tr>
  </tbody>
</table>
</div>
<?php echo file_get_contents($this->articlebase . $bottomid);?>